//
//  CustomAnnotation.m
//  MapDemo
//
//  Created by 卫建 on 15/12/14.
//  Copyright © 2015年 卫建. All rights reserved.
//

#import "CustomAnnotation.h"

@implementation CustomAnnotation

-(NSString *)title
{
    return _title;
}

-(NSString *)subtitle
{
    NSMutableString *ret = [NSMutableString new];
    
    if (_state)
    {
        [ret appendString:_state];
    }
    if (_city)
    {
        [ret appendString:_city];
    }
    if (_city && _state)
    {
        [ret appendString:@","];
    }
    if (_streetAddress && (_city || _state || _zip))
    {
        [ret appendString:@" . "];
    }
    if (_streetAddress)
    {
        [ret appendString:_streetAddress];
    }
    if (_zip)
    {
        [ret appendFormat:@",%@",_zip];
    }
    return ret;
}

@end
